package xierpaixu;

import java.util.Date;
import java.text.SimpleDateFormat;
import java.util.Random;

public class text02 {
    public static void main(String[] args) {
        Random random1 = new Random();
        int arr[] = new int[80000];
        for (int i = 0; i < 80000; i++) {
            arr[i] = random1.nextInt();
        }
        Date date1 = new Date();
        SimpleDateFormat f1 = new SimpleDateFormat("yyyy-mm-dd hh:mm:ss");
        System.out.println(f1.format(date1));
        xerpx(arr);
        Date date2 = new Date();
        //  SimpleDateFormat f2 = new SimpleDateFormat("yyyy-mm-dd hh:mm:ss");
        System.out.println(f1.format(date2));
    }
    static void xerpx(int arr[]){
        for (int gap = arr.length/2; gap >0; gap/=2) {
            for (int i = gap; i < arr.length; i++) {
                for (int j = i-gap; j >=0; j-=gap) {
                    if(arr[j]>arr[j+gap]){
                        int temp=arr[j];
                        arr[j]=arr[j+gap];
                        arr[j+gap]=temp;
                    }
                }
            }
        }
    }
}